package data

import (
	"github.com/google/wire"
)

var ProviderSet = wire.NewSet(NewData, NewUserRepo, NewVipInfoRepo)

// Data .
type Data struct {
	// db *ent.Client
}

// NewData .
func NewData() (*Data, error) {
	//func NewData() (*Data, func(), error) {
	//client, err := ent.Open(
	//	conf.Database.Driver,
	//	conf.Database.Source,
	//)
	//if err != nil {
	//	log.Errorf("failed opening connection to sqlite: %v", err)
	//	return nil, nil, err
	//}
	//// Run the auto migration tool.
	//if err := client.Schema.Create(context.Background()); err != nil {
	//	log.Errorf("failed creating schema resources: %v", err)
	//	return nil, nil, err
	//}
	//d := &Data{
	//	db: client,
	//}
	//return d, func() {
	//	if err := d.db.Close(); err != nil {
	//		log.Error(err)
	//	}
	//}, nil

	return &Data{}, nil
}
